﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SilverTile;
using SilverTile.ExtensionMethods;

namespace SilverTileTests
{

    [TestClass]
    public class ColorExtensionMethodsTests
    {

        [TestMethod]
        public void ToInt32_And_ToColor_Should_Be_Complementary()
        {

            int color1, color2, color3, color4;
            unchecked
            {
                color1 = (int)0xFF223344;
                color2 = (int)0x00001122;
                color3 = (int)0xFF220055;
                color4 = (int)0x55443300;
            }

            PerformColorAssert(0);
            PerformColorAssert(int.MaxValue);
            PerformColorAssert(color1);
            PerformColorAssert(color2);
            PerformColorAssert(color3);
            PerformColorAssert(color4);

        }

        private void PerformColorAssert(int color)
        {
            Assert.AreEqual(color, color.ToColor().ToInt32(), color + " to color to int does not return " + color);
        }

    }
}
